
import {simpleServer} from '@/tools/servers'

/**
 * 商品信息
 */
export class GoodsService {
    // 分页查询列表
    static findGoodss (pageDTO) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.findGoodss,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/findGoodss', body);
    }


    //根据商品信息Id查询商品信息
    static findGoods (goodsId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoods ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/findGoods',body);
    }

    //为了编辑,根据商品信息Id查询商品信息
    static findGoodsForEdit(goodsId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodsForEdit ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/findGoodsForEdit',body);
    }

    //为了查看,根据商品信息Id查询商品信息，所有外键字段的名称都已加载
    static findGoodsForView(goodsId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodsForView ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/findGoodsForView',body);
    }

    //创建新的商品信息
    static createGoods() {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.createGoods,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/createGoods',body);
    }

    //保存商品信息
    static saveGoods(goods) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.saveGoods,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/saveGoods', body);
    }

    //编辑商品信息
    static updateGoods (goods) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.updateGoods,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/updateGoods', body);
    }

    //根据商品信息Id删除商品信息
    static deleteGoods (goodsId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.deleteGoods,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/deleteGoods',body);
    }

    //为了查看,根据商品信息Id查询商品信息，只加载ID 和 名称
    static findGoodssWithIdNameById(goodsId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodssWithIdNameById ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/findGoodssWithIdNameById',body);
    }

    //为了查看,根据商品信息 名称 查询商品信息，只加载ID 和 名称
    static findGoodssWithIdNameByName(goodsName) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findGoodssWithIdNameByName ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/goods/Goods/findGoodssWithIdNameByName',body);
    }


}
